const nextRelationCreate = (conData, pIds) => {
  if (!pIds.length) return
  let parentRelationData = conData.children.find(item => item.id == pIds[0])
  if (!parentRelationData) {
    parentRelationData = {id: pIds[0], model: "relationCon", children: []}
    conData.children.push(parentRelationData)
  }
  pIds.shift()
  nextRelationCreate(parentRelationData, pIds)
}


let conData = {"id":"000","model":"relationCon","children":[{"id":"111","model":"relationCon","children":[{"id":"222","model":"relationCon","children":[]}]}]}

let idList = ['111', '222']

nextRelationCreate(conData, idList)
console.log(JSON.stringify(conData))
